import lombok.extern.slf4j.Slf4j;
import spring.cloud.tasks.tasks_manager.task_item_assign.ExecutorSupportedTaskIdList;
import spring.cloud.tasks.tasks_manager.task_item_assign.TaskItemContainer;

import java.util.concurrent.ExecutionException;

@Slf4j
public class ExecutorSupportedTaskIdListCache {


    public static void main(String[] args) throws ExecutionException {

        // 第一次读取
        for (int i = 0; i < 20; i++) {
            ExecutorSupportedTaskIdList user = TaskItemContainer.executorIdToExecutorSupportedTaskIdListCache.get("uid" + i);
            if (ExecutorSupportedTaskIdList.$null$ == user) {
                user = new ExecutorSupportedTaskIdList();
            } else {
                String executorId = user.executorId;
                long version = user.version;
                //比较当前的版本
            }
            System.out.println(user);
        }


        //最后打印缓存的命中率等 情况
        System.out.println(TaskItemContainer.executorIdToExecutorSupportedTaskIdListCache.stats().toString());

    }
}

